package com.karaoke.android.data

import android.app.Application
import com.apkfuns.logutils.LogUtils
import org.simple.eventbus.EventBus
import kotlin.properties.Delegates

/**
 * Created by Administrator on 2017/4/1.
 */
data class VolumeChangedEvent(val value: Int)

const val PLAYER_EVENT_TAG_VIEW_CREATE = "PLAYER_EVENT_TAG_VIEW_CREATE"
const val PLAYER_EVENT_TAG_START_PLAY = "PLAYER_EVENT_TAG_START_PLAY"
const val PLAYER_EVENT_TAG_VIEW_Destroyed = "PLAYER_EVENT_TAG_VIEW_Destroyed"

const val CLIENT_REQUEST_SERVICE = "CLIENT_REQUEST_SERVICE"
const val CLIENT_INIT = "INIT"
const val CLIENT_CLEAN_SERVICE = "CLIENT_CLEAN_SERVICE"
const val CLIENT_POST_CURRENT_PLAY = "CLIENT_POST_CURRENT_PLAY"
const val SERVER_IP_ADDRESS = "SERVER_IP_ADDRESS"

const val MASTER_VOLUME_CHANGED = "MASTER_VOLUME_CHANGED"

var masterVolume by Delegates.observable(1f, { _, old, new ->
    LogUtils.e("volume new $new old $old")
    EventBus.getDefault().post(new, MASTER_VOLUME_CHANGED)
})


class LoadMoreEvent

/**
 * 静音之前音量，取消静音恢复值
 */
var lastVolume = 1f

//var mediaList: PlayList by Delegates.notNull()

var seekPosition = 0L


var app: Application by Delegates.notNull()
